package com.eliza.springboot.v3

import com.eliza.springboot.v3.config.properties.CustomBasicConfig
import com.eliza.springboot.v3.config.properties.CustomConfig
import com.eliza.springboot.v3.config.properties.CustomSheepConfig
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.data.jpa.repository.config.EnableJpaRepositories
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories

@SpringBootApplication

@EnableJpaRepositories(basePackages = ["com.eliza.springboot.v3.repository.repo.postgresql"])
@EnableMongoRepositories(basePackages = ["com.eliza.springboot.v3.repository.repo.mongo"])

class V3Application {
    companion object {
        @JvmStatic
        fun main(args: Array<String>) {
            val runApplication = runApplication<V3Application>(*args)
            val beanNamesForType = runApplication.getBean(CustomBasicConfig::class.java)

            println("beanNamesForType $beanNamesForType")
            println("beanNamesForType ${runApplication.getBean(CustomConfig::class.java)}")
            println("beanNamesForType ${runApplication.getBean(CustomSheepConfig::class.java)}")

        }
    }

}

//fun main(args: Array<String>) {
//    val runApplication = runApplication<V3Application>(*args)
//    val beanNamesForType = runApplication.getBean(CustomBasicConfig::class.java)
//
//
//    println("beanNamesForType $beanNamesForType")
//    println("beanNamesForType ${runApplication.getBean(CustomConfig::class.java)}")
//    println("beanNamesForType ${runApplication.getBean(CustomSheepConfig::class.java)}")
//}
